// pages/intro/ls/ls/ls.js
const db =wx.cloud.database()
const app = getApp()

Page({
data: {
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),
dataobj :""
},
//事件处理函数
bindViewTap: function() {
wx.navigateTo({
url: '../introduce/introduce'
})
},
imageLoad: function (e) {
var _this = this;
var $width = e.detail.width, 
$height = e.detail.height,
ratio = $width / $height; 
var viewWidth = 500, 
viewHeight =500 / ratio; 
this.setData({
imgwidth: viewWidth,
imgheight: viewHeight
})

},
getDate(){
  
  db.collection("lscomment").doc("79550af260acf3d21a21c83814bd5afa").get({
    success:res=>{
      console.log(res)
      this.setData({
        dataobj:res.data
      })
    }
  })
},
getUserInfo: function(e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
}
})